<template>
	<page>
    <view class="wallet-info">
      <view class="wallet-icon">
        <view class="icon">
          <image src="/static/images/icon/qbye_icon.png"></image>
        </view>
      </view>
      <view class="title">
        <text>我的余额</text>
      </view>
      <view class="balance">
        <text class="min">￥</text>
        <text>{{info.balance}}</text>
      </view>
      <view class="more" @click="onBalance">
        <text>余额明细</text>
        <text class="right-arrows"></text>
      </view>
    </view>
<!--    充值-->
    <view class="footer-btn">
      <view class="btn" @click="onRecharge">
        <text>充值</text>
      </view>
    </view>
	</page>
</template>

<script setup>

import {getWalletBalance} from "../../../api/wallet";
import {onLoad, onShow} from "@dcloudio/uni-app";
import {ref} from "vue";

const info = ref({});

onLoad(() =>{
})

onShow(() =>{
  getData();
})
/**
 * 获取数据
 */
function getData(){
  getWalletBalance({

  }).then(res =>{
    info.value = res.data;
  })
}
/**
 * 充值点击
 */
function onRecharge(){
  uni.navigateTo({
    url: '/view/mine/recharge/recharge'
  })
}

/**
 * 余额明细点击
 */
function onBalance(){
  uni.navigateTo({
    url: '/view/mine/WalletRecord/WalletRecord'
  })
}
</script>

<style lang="scss">
  @import "wallet.scss";
</style>
